package me.zingon.web.mvc;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@EnableWebMvc
@Configuration 
public class SpringMVCConfig extends WebMvcConfigurerAdapter{

	@Override
	public void addViewControllers(ViewControllerRegistry registry) {
		super.addViewControllers(registry);
		registry.addViewController("/user.*").setViewName("/login");
		registry.addViewController("/register.*").setViewName("/register");
		registry.addViewController("/jwc.*").setViewName("/grade");
		registry.addViewController("/pj.*").setViewName("/pj");
		registry.addViewController("/package.*").setViewName("/package");
		registry.addViewController("/materials.*").setViewName("/materials/display");
		registry.addViewController("/materials/upload.*").setViewName("/materials/upload");
	}
}
